<?php
namespace BtcTool;

use BitWasp\Bitcoin\Key\PrivateKeyFactory;
use BitWasp\Bitcoin\Address\PayToPubKeyHashAddress;

class Credential{
  public $prv;
  public $pub;
  public $p2pkh;
  
  public function __construct($prv){
    $this->prv = $prv;
    $this->pub = $prv->getPublicKey();
    $this->p2pkh = new PayToPubKeyHashAddress($prv->getPubKeyHash());
  }
  
  public static function new(){
    $prv = PrivateKeyFactory::create(true);
    return new self($prv);
  }
}